<?php namespace app\admin\controller;
 use houdunwang\session\Session;
 use system\model\User;
class Login{
    //动作
        public  function index(){
            if(IS_POST){
                $res=(new User())->login();
                if($res['valid']){
                  header('location:index.php?s=admin/index/index');
                }
//                if(!$res['valid']){
//                    message($res['message'],$redirect='back',$type='error',$time=2);
//                }
//                message($res['message'],u('admin.index.index'),$type='success',$time=2);
            }
            return view();
        }
        public  function code(){
            Code::num(4)->make();
        }
}
